/*
    This file is part of the Time-of-Flight Tracer program. It is not part of
    the original PBRT source distribution. See the included license file for
    more information.

    Copyright(c) 2014 Microsoft Corporation

    Author: Phil Pitts
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef PBRT_FILM_BACKSCATTER_HISTOGRAM_H
#define PBRT_FILM_BACKSCATTER_HISTOGRAM_H

#include "pbrt.h"
#include "film/backscatter.h"


class HistogramFilm : public BackscatterFilm {
public:
	HistogramFilm(int xres, int yres, const string &fn, float size, float range, 
		float minL);
	~HistogramFilm();

	void AddSample(const CameraSample &sample, const PaintData &paint);
	void Splat(const CameraSample &sample, const PaintData &paint);
	void WriteImage(float splatScale);

private:
	BlockedArray<Histogram*> *pixels;
	float minimumL, binSize;
	int nBins;
	bool averageDistance;
};


HistogramFilm *CreateHistogramFilm(const ParamSet &params);

#endif // PBRT_FILM_BACKSCATTER_HISTOGRAM_H